import React from 'react';
import { Card } from 'antd';
import './DataCard.css';

interface DataCardProps {
  title: string;
  value: string | number;
  description?: string;
  icon?: React.ReactNode;
  className?: string;
  onClick?: () => void;
}

export const DataCard: React.FC<DataCardProps> = ({
  title,
  value,
  description,
  icon,
  className = '',
  onClick
}) => {
  return (
    <Card
      className={`data-card ${className}`}
      hoverable
      onClick={onClick}
    >
      <div className="data-card-content">
        {icon && <div className="data-card-icon">{icon}</div>}
        <div className="data-card-info">
          <div className="data-card-title">{title}</div>
          <div className="data-card-value">{value}</div>
          {description && (
            <div className="data-card-description">{description}</div>
          )}
        </div>
      </div>
    </Card>
  );
};